package net.borlis.sample.web.context;

/**
 * The base class for all web services.
 *
 * @author alex@borlis.net
 */
public abstract class DynamixWebService<CONTEXT extends WeldWebContext> {

//    @Inject
//    private WeldWebContext context;

    // -=-=-=-=-=-
    protected static final String LOCALE_LOG_PATTERN = "%s <= (locale= %s)";
    protected static final String LOCALE_USER_LOG_PATTERN = "%s <= (locale= %s, userId= %s)";
    protected static final String LOCALE_USER_ADD_PATTERN = "%s <= (locale= %s, userId= %s, %s)";
    // -=-=-=-=-=-
    protected static final String LOCALE_USER_VITO_LOG_PATTERN = "%s <= (locale= %s, userId= %s, vitoId = %s)";
    protected static final String LOCALE_USER_VITO_ADD_LOG_PATTERN = "%s <= (locale= %s, userId= %s, vitoId = %s, %s)";
    // -=-=-=-=-=-

    public CONTEXT getContext() { //todo:: use the container here! sprint#16
        return WeldBeanManager.loadBeanInstanceFor(getContextClass());
    }

    public abstract Class<CONTEXT> getContextClass();

}
